
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} Root_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/base Base_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/window Window_src)

#link_directories("I:\\programs\\YDT\\java-se-8u40-ri\\lib")
include_directories("C:\\Program Files (x86)\\Mono-2.11.4\\include\\mono-2.0")

set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
add_library(climain SHARED ${Root_src} ${Base_src} ${Window_src})

target_link_libraries(climain duilib clicore)
set_target_properties(climain PROPERTIES OUTPUT_NAME "climain")
#set_target_properties(climain PROPERTIES LINKER_FLAGS "-Wl,--enable-stdcall-fixup")
add_custom_command(TARGET climain POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/lib/libclimain.dll ${PROJECT_SOURCE_DIR}/bin/libclimain.dll
  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/lib/libclimain.dll ${PROJECT_BINARY_DIR}/client/libclimain.dll
)